USE [HR_DB]
GO
if exists(select * from dbo.sysobjects where id = object_id(N'config_primary_key')   and   OBJECTPROPERTY(id,   N'IsUserTable')   =   1)   
  drop table config_primary_key  
-- =============================================
-- Author:杨洁(kaixuanpisces)
-- Create date: 20090825
-- Description:关键字设置
-- (包括人力资源管理，薪酬发放，激励管理，
-- 调动管理，薪酬标准，培训)
-- =============================================
CREATE TABLE [dbo].[config_primary_key](
	[prk_id] [smallint] IDENTITY(1,1) NOT NULL,
	[primary_key_table] [varchar](60) NULL,
	[primary_key] [varchar](60) NULL,
	[key_name] [varchar](60) NULL,
	[primary_key_status] [bit] NULL,
 CONSTRAINT [config_primary_key_PK] PRIMARY KEY CLUSTERED 
(
	[prk_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

-- ==============================================
-- 列名说明
-- ==============================================
GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主键，自动增长列' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'config_primary_key', @level2type=N'COLUMN',@level2name=N'prk_id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'关键字所涉及的数据库表名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'config_primary_key', @level2type=N'COLUMN',@level2name=N'primary_key_table'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'关键字' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'config_primary_key', @level2type=N'COLUMN',@level2name=N'primary_key'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'中文关键字' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'config_primary_key', @level2type=N'COLUMN',@level2name=N'key_name'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否为关键字' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'config_primary_key', @level2type=N'COLUMN',@level2name=N'primary_key_status'



-- ===============================================
-- 测试数据
-- ===============================================
go


insert into config_primary_key values('HumanFile','firstKindName','I机机构名称',1)
insert into config_primary_key values('HumanFile','secondKindName','II机机构名称',1)
insert into config_primary_key values('HumanFile','thirdKindName','III机机构名称',1)
insert into config_primary_key values('HumanFile','humanId','档案编号',1)
insert into config_primary_key values('HumanFile','humanName','姓名',1)
insert into config_primary_key values('HumanFile','humanAddress','住址',1)
insert into config_primary_key values('HumanFile','humanPostcode','邮编',1)
insert into config_primary_key values('HumanFile','humanProDesignation','职称',1)
insert into config_primary_key values('HumanFile','humanMajorKindName','职位分类名称',1)
insert into config_primary_key values('HumanFile','hunmaMajorName','职位名称',1)
insert into config_primary_key values('HumanFile','humanBank','开户银行',1)
insert into config_primary_key values('HumanFile','humanAccount','银行帐号',1)
insert into config_primary_key values('HumanFile','humanTelephone','电话',1)
insert into config_primary_key values('HumanFile','humanMobilephone','手机号码',1)
insert into config_primary_key values('HumanFile','humanEmail','E-mail',1)
insert into config_primary_key values('HumanFile','humanHobby','爱好',1)
insert into config_primary_key values('HumanFile','humanSpeciality','特长',1)
insert into config_primary_key values('HumanFile','humanSex','性别',1)
insert into config_primary_key values('HumanFile','humanReligion','宗教信仰',1)
insert into config_primary_key values('HumanFile','humanParty','政治面貌',1)
insert into config_primary_key values('HumanFile','humanNationality','国籍',1)
insert into config_primary_key values('HumanFile','humanRace','民族',1)
insert into config_primary_key values('HumanFile','humanBirthday','生日',1)
insert into config_primary_key values('HumanFile','humanBirthplace','出生地',1)
insert into config_primary_key values('HumanFile','humanAge','年龄',1)
insert into config_primary_key values('HumanFile','humanEducatedDegree','学历',1)
insert into config_primary_key values('HumanFile','humanEducatedYears','教育年限',1)
insert into config_primary_key values('HumanFile','humanEducatedMajor','专业',1)
insert into config_primary_key values('HumanFile','humanSocietySecurityId','社会保障号码',1)
insert into config_primary_key values('HumanFile','humanIdCard','身份证号码',1)
insert into config_primary_key values('HumanFile','salaryStandardId','薪酬标准编号',1)
insert into config_primary_key values('HumanFile','salaryStandardName','薪酬标准',1)
insert into config_primary_key values('HumanFile','majorChangeAmount','调动次数',1)
insert into config_primary_key values('HumanFile','bonusAmount','激励次数',1)
insert into config_primary_key values('HumanFile','trainingAmount','培训次数',1)
insert into config_primary_key values('HumanFile','fileChangAmount','档案变更次数',1)
insert into config_primary_key values('HumanFile','remark','备注',1)
insert into config_primary_key values('HumanFile','humanHistroyRecords','简历',1)
insert into config_primary_key values('HumanFile','humanFamilyMembership','家庭关系',1)
insert into config_primary_key values('HumanFile','register','登记人',1)
insert into config_primary_key values('SalaryStandard','standardId','薪酬标准编号',1)
insert into config_primary_key values('SalaryStandard','standardName','薪酬标准名称',1)
insert into config_primary_key values('SalaryStandard','designer','设计人',1)
insert into config_primary_key values('SalaryGrant','salaryStandardId','薪酬标准编号',1)
insert into config_primary_key values('SalaryGrant','salaryGrantId','薪酬发放编号',1)
insert into config_primary_key values('Bonus','majorKindName','职位分类名称',1)
insert into config_primary_key values('Bonus','majorName','职位名称',1)
insert into config_primary_key values('Bonus','humanId','员工编号',1)
insert into config_primary_key values('Bonus','humanName','职员工姓名',1)
insert into config_primary_key values('Bonus','bonusItem','激励项目',1)
insert into config_primary_key values('Bonus','bonusDegree','激励等级',1)
insert into config_primary_key values('Bonus','remark','备注',1)
insert into config_primary_key values('Training','majorKindName','职位分类名称',1)
insert into config_primary_key values('Training','majorName','职位名称',1)
insert into config_primary_key values('Training','humanId','员工编号',1)
insert into config_primary_key values('Training','humanName','职员工姓名',1)
insert into config_primary_key values('Training','trainingItem','培训项目',1)
insert into config_primary_key values('Training','trainingDegree','培训等级',1)
insert into config_primary_key values('Training','remark','备注',1)
insert into config_primary_key values('MajorChange','firstKindName','I机机构',1)
insert into config_primary_key values('MajorChange','secondKindName','II机机构',1)
insert into config_primary_key values('MajorChange','thirdKindName','III机机构',1)
insert into config_primary_key values('MajorChange','majorKindName','职位分类',1)
insert into config_primary_key values('MajorChange','majorName','职位',1)
insert into config_primary_key values('MajorChange','humanId','员工编号',1)
insert into config_primary_key values('MajorChange','humanName','员工姓名',1)
insert into config_primary_key values('MajorChange','changeReason','调动原因',1)